/*
 * MineralSolution.cpp
 *
 *  Created on: 28 May 2011
 *      Author: allan
 */

#include "MineralSolution.h"

MineralSolution::MineralSolution() 
{}

MineralSolution::MineralSolution(const vector<string>& species) :
species(species)
{}

MineralSolution::~MineralSolution()
{}

const string MineralSolution::GetName() const
{
	return "Mineral";
}

const vector<string> MineralSolution::GetSpecies() const
{
	return species;
}

const VectorXd MineralSolution::MolarFractions(const VectorXd& n) const
{
	return n / n.sum();
}

const VectorXd MineralSolution::Concentrations(const VectorXd& n) const
{
	return MolarFractions(n);
}

const VectorXd MineralSolution::ActivityCoefficients(double T, double P, const VectorXd& n) const
{
	return VectorXd::Ones(n.rows()); // Activity coefficients are currently assumed ideal, e.g., gamma = 1
}

const VectorXd MineralSolution::Activities(double T, double P, const VectorXd& n) const
{
	return MolarFractions(n).array() * ActivityCoefficients(T, P, n).array();
}
